package com.kly.agent.demo.springai;

import jakarta.annotation.Resource;
import org.springframework.ai.chat.model.ChatModel;
import org.springframework.ai.chat.prompt.Prompt;
import org.springframework.boot.CommandLineRunner;
import org.springframework.context.annotation.Configuration;

/**
 * @author admin
 * @date 2025/5/19
 */
@Configuration
public class ChatModelTest implements CommandLineRunner {

    @Resource
    private ChatModel dashScopeChatModel;

    @Override
    public void run(String... args) throws Exception {
        Prompt prompt = new Prompt("你好！我是蔡徐坤！你知道我吗？");
        String content = dashScopeChatModel.call(prompt).getResult()
                .getOutput().getContent();
        System.out.println(content);
    }
}
